package ns.gflex.services

import ns.gflex.domain.*;
import ns.gflex.domain.association.*;
import ns.gflex.domain.Param;
import ns.gflex.domain.User;

/**
 * Functions
 * @since Dec 22, 2010
 * @author wangchu
 */
class InitService extends GFlexService {
	def init(){
		if(User.count()>0||Role.count()>0||Menu.count()>0){
			throw new RuntimeException('System already initialized, please check database table "User,Role,Menu".')
		}
		Department.init();
		Role.init();
		User.init();
		Menu.init();
		Param.init();
	}
}
